#include<stdio.h>
#include<malloc.h>
#include<string.h>

typedef struct Person
{
    char name[20];
    char phone[20];
    char address[30];
}Person,*pPerson;

typedef struct Time
{
    int year;
    int month;
    int day;
}Time,*pTime;

typedef struct courierBill
{
    int id;
    Person sender,receiver;
    char sendCity[20],receiveCity[20];
    char serviceCompany[20];
    Time send,receive;
    int price;
}Paper,*pPaper;

Paper personSplit(char temp[ ],pPerson now)
{
    int i=0,j=0;
    for(;i<strlen(temp);i++){
        if(temp[i]==':'){
            i++;
            break;
        }
    }
    for(;i<strlen(temp);i++){
        if(temp[i]==','){
            now->name[j++]='\0';
            j=0;
            i=i+1;
            break;
        }
        now->name[j++]=temp[i];
    }
    for(;i<strlen(temp);i++){\
        if(temp[i]==','){
            now->phone[j++]='\0';
            j=0;
            i=i+1;
            break;
        }
        now->phone[j++]=temp[i];
    }
    for(;i<strlen(temp);i++){
        now->address[j++]=temp[i];
    }
    now->address[j++]='\0';
}

int main()
{
    int n;
    pPaper now[10];
    scanf("n=%d",&n);
    getchar();
    for(int i=0;i<n;i++){
        now[i]=(pPaper)malloc(sizeof(Paper));
        scanf("快递单号:%d",&(now[i]->id));
        getchar();
        char temp[100];
        gets(temp);
        personSplit(temp,&(now[i]->sender));
        gets(temp);
        personSplit(temp,&(now[i]->receiver));
        scanf("始发城市:%s",now[i]->sendCity);
        getchar();
        scanf("目的城市:%s",now[i]->receiveCity);
        getchar();
        scanf("快递服务商:%s",now[i]->serviceCompany);
        getchar();
        scanf("发送时间:%d.%d.%d",&(now[i]->send.year),&(now[i]->send.month),&(now[i]->send.day));
        getchar();
        scanf("接收时间:%d.%d.%d",&(now[i]->receive.year),&(now[i]->receive.month),&(now[i]->receive.day));
        getchar();
        scanf("快递价格:%d",&(now[i]->price));
        getchar();
    }
    for(int i=0;i<n;i++){
        printf("快递单号:%d\n",now[i]->id);
        printf("发货方:%s,%s,%s\n",now[i]->sender.name,now[i]->sender.phone,now[i]->sender.address);
        printf("接收方:%s,%s,%s\n",now[i]->receiver.name,now[i]->receiver.phone,now[i]->receiver.address);
        printf("始发城市:%s\n",now[i]->sendCity);
        printf("目的城市:%s\n",now[i]->receiveCity);
        printf("快递服务商:%s\n",now[i]->serviceCompany);
        printf("发送时间:%d.%02d.%02d\n",now[i]->send.year,now[i]->send.month,now[i]->send.day);
        printf("接收时间:%d.%02d.%02d\n",now[i]->receive.year,now[i]->receive.month,now[i]->receive.day);
        printf("快递价格:%d\n",now[i]->price);
        if(i!=n-1)  printf("==========\n");
    }

}